home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJLSR200.ZIP / src / libc / posix / sys / stat / djbits.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  5.2 KB  |  164 lines

  1. @node _djstat_flags, stdio
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <sys/stat.h>
  6.  
  7. extern unsigned short   _djstat_flags;
  8. @end example
  9.  
  10. This variable contains bits for some fields of struct stat which are
  11. expensive to compute under DOS.  Any such computation is only done by
  12. @ref{stat} or @ref{fstat} if the corresponding bit in
  13. @code{_djstat_flags} is cleared.  By default, all the bits are
  14. cleared, so applications which don't care, automagically get a full
  15. version, possibly at a price of performance.  To get the fastest
  16. possible @code{f?stat()} for your application, clear only the bits
  17. which you need and set all the others.
  18.  
  19. The following bits are currently defined:
  20.  
  21. @table @code
  22.  
  23. @item _STAT_INODE
  24.  
  25. Causes @code{f?stat()} to compute the @code{st_ino} (inode number) field.
  26.  
  27. @item _STAT_EXEC_EXT
  28.  
  29. Tells @code{f?stat()} to compute the execute access bit from extension.
  30.  
  31. @item _STAT_EXEC_MAGIC
  32.  
  33. Tells @code{f?stat()} to compute the execute access bit from magic
  34. signature (the first two bytes of the file, see @ref{_is_executable}.
  35. Note that if _STAT_EXEC_MAGIC is set, but _STAT_EXEC_EXT is not, some
  36. files which shouldn't be flagged as executables (e.g., COFF *.o object
  37. files) will have their execute bit set, because they have the magic
  38. number signature at their beginning.  Therefore, only use the above
  39. combination if you want to debug the list of extensions provided in
  40. is_exec.c file.
  41.  
  42. @item _STAT_DIRSIZE
  43.  
  44. Causes @code{stat} to compute directory size by counting the number of its
  45. entries (unless some friendly network redirector brought a true directory
  46. size with it).
  47.  
  48. @item _STAT_ROOT_TIME
  49.  
  50. Causes @code{stat()} to try to get time stamp of root directory from its
  51. volume label entry, if there is one.
  52.  
  53. @item _STAT_WRITEBIT
  54.  
  55. Tells @code{fstat()} that file's write access bit is required (this could
  56. be a problem only under some versions of Novell Netware).
  57.  
  58. @end table
  59.  
  60. Note that if you set a bit, some failure bits in @ref{_djstat_fail_bits}
  61. might not be set, because some computations which report failures are only
  62. done when they are required.
  63.  
  64. @node _djstat_fail_bits, stdio
  65. @subheading Syntax
  66.  
  67. @example
  68. #include <sys/stat.h>
  69.  
  70. extern unsigned short   _djstat_fail_bits;
  71. @end example
  72.  
  73. As proper operation of @ref{stat} and @ref{fstat} depend on
  74. undocumented DOS features, they could fail in some incompatible
  75. environment or a future DOS version.  If they do, the
  76. @code{_djstat_fail_bits} variable will have some of its bits set.
  77. Each bit describes a single feature which was used and failed.  The
  78. function @ref{_djstat_describe_lossage} may be called to print a
  79. human-readable description of the bits which were set by the last call
  80. to @code{f?stat()}.  This should make debugging @code{f?stat()}
  81. failures in an unanticipated environment a lot easier.
  82.  
  83. The following bits are currently defined:
  84.  
  85. @table @code
  86.  
  87. @item _STFAIL_SDA
  88.  
  89. Indicates that Get SDA call failed.
  90.  
  91. @item _STFAIL_OSVER
  92.  
  93. Indicates an unsupported DOS version (less than 3.10 for @code{stat()} or
  94. less than 2.0 for @code{fstat()}).
  95.  
  96. @item _STFAIL_BADSDA
  97.  
  98. The pointer to SDA was found to be bogus.
  99.  
  100. @item _STFAIL_TRUENAME
  101.  
  102. Indicates that @ref{_truename} function call failed.
  103.  
  104. @item _STFAIL_HASH
  105.  
  106. Indicates that the starting cluster of the file is unavailable, and inode
  107. number was computed by hashing its name.
  108.  
  109. @item _STFAIL_LABEL
  110.  
  111. The application requested the time stamp of a root dir, but no volume
  112. label was found.
  113.  
  114. @item _STFAIL_DCOUNT
  115.  
  116. The number of SDA reported is ridiculously large (probbaly an unsupported
  117. DOS clone).
  118.  
  119. @item _STFAIL_WRITEBIT
  120.  
  121. @code{fstat()} was asked to get write access bit of a file, but couldn't.
  122.  
  123. @item _STFAIL_DEVNO
  124.  
  125. @code{fstat()} failed to get device number.
  126.  
  127. @item _STFAIL_BADSFT
  128.  
  129. An SFT entry for this file was found by @code{fstat()}, but its contents
  130. can't be trusted because it didn't match file size and time stamp as
  131. reported by DOS.
  132.  
  133. @item _STFAIL_SFTIDX
  134.  
  135. The SFT index in Job File Table in program's PSP is negative.
  136.  
  137. @item _STFAIL_SFTNF
  138.  
  139. The file entry was not found in the SFT array.
  140.  
  141. @end table
  142.  
  143. Below are some explanations of terminology and abbreviations used by the
  144. printed messages, which will further clarify the meaning of the above bits
  145. and their descriptions printed by @ref{_djstat_describe_lossage}.
  146.  
  147.   SDA (Swappable DOS Area) -- this is an internal DOS structure.
  148. @code{stat()} uses it to get the full directory entry (including the
  149. starting cluster number) of a file.  The pointer to SDA found by
  150. @code{stat()} is trusted only if we find the pathname of our file at a
  151. specific offset in that SDA.
  152.  
  153.   SFT (System File Table) -- another internal DOS structure, used in file
  154. operations.  @code{fstat()} uses it to get full information on a file
  155. given its handle.  An SFT entry which is found by @code{fstat()} is only
  156. trusted if it contains files size and time stamp like those returned by
  157. DOS functions 57h and 42h.  Novell NetWare 3.x traps DOS file operations
  158. in such a way they never get to SFT, so some failure messages refer
  159. specifically to Novell.
  160.  
  161.   Hashing -- the fall-back method of returning a unique inode number for
  162. each file.  It is used whenever the starting cluster of a file couldn't be
  163. reliably determined.
  164.